﻿<%@ Page Language="C#" MasterPageFile="~/administrator/Admin.Master" AutoEventWireup="true" CodeBehind="Supplier.aspx.cs" Inherits="KTSonline.administrator.Supplier" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div class="title">Quản lý Nhà sản xuất</div>
    <asp:GridView ID="GridView1" runat="server" AllowPaging="True" CssClass="datagrid"
        AutoGenerateColumns="False" DataKeyNames="id" DataSourceID="LinqDataSource1">
        <Columns>
            <asp:BoundField DataField="id" HeaderText="Mã" InsertVisible="False" 
                ReadOnly="True" SortExpression="id" />
            <asp:BoundField DataField="tennhasanxuat" HeaderText="Tên" 
                SortExpression="tennhasanxuat" />
            <asp:TemplateField HeaderText="Logo" SortExpression="logo">
                <EditItemTemplate>
                    <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("logo") %>'></asp:TextBox>
                </EditItemTemplate>
                <ItemTemplate>
                    <img src="<%# getLogoURL(Eval("logo")) %>" alt="logo"/>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Link" SortExpression="url">
                <EditItemTemplate>
                    <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("url") %>'></asp:TextBox>
                </EditItemTemplate>
                <ItemTemplate>
                    <a href="<%# Eval("url") %>"><%# Eval("url") %></a>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField ShowHeader="False">
                <EditItemTemplate>
                    <asp:LinkButton ID="btnUpdate" runat="server" CausesValidation="True" 
                        CommandName="Update" Text="Update"></asp:LinkButton>
                    &nbsp;<asp:LinkButton ID="btnCancel" runat="server" CausesValidation="False" 
                        CommandName="Cancel" Text="Cancel"></asp:LinkButton>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:LinkButton ID="btnEdit" runat="server" CausesValidation="False" 
                        CommandName="Edit" Text="Edit"></asp:LinkButton>
                    &nbsp;<asp:LinkButton ID="btnDelete" runat="server" CausesValidation="False" OnClientClick="return confirm('Delete this supplier?');"
                        CommandName="Delete" Text="Delete"></asp:LinkButton>
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
    </asp:GridView>
    <asp:LinqDataSource ID="LinqDataSource1" runat="server" 
        ContextTypeName="KTSonline.KTSonlineDataContext" EnableDelete="True" 
        EnableInsert="True" EnableUpdate="True" TableName="NHA_SAN_XUATs">
    </asp:LinqDataSource>

</asp:Content>
